package com.sieaf.exception;

import java.io.Serializable;
	/**
	 * @param args
	 */
	public class BusinessException extends AppException {

		private String logType;

		private String logDateTime;

		private String logDesc;

		private Exception exception;

		private String clientDesc;

		private String clientType;
		
		private String errorCode;

	    public BusinessException(){
			long currentTime = System.currentTimeMillis();
			java.util.Date date = new java.util.Date(currentTime);
			java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");
	        this.logDateTime = formatter.format(date) ;
		}
	    public BusinessException(String s){
			/*long currentTime = System.currentTimeMillis();
			java.util.Date date = new java.util.Date(currentTime);
			java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat ("yyyy-MM-dd hh:mi:ss");
	        this.logDateTime = formatter.format(date) ;*/
	        clientDesc=s;
	        errorCode=s;
		}
		public String getLogType(){
			return logType;
		}
		public String getLogDateTime(){
			return logDateTime;
		}
		public String getLogDesc(){
			return logDesc;
		}
		public Exception getException(){
			return exception;
		}
		public String getClientDesc(){
			return clientDesc;
		}
		public String getClientType(){
		    return clientType;
		}
		public String getErroCode(){
		    return errorCode;
		}
		public void setClientDesc(String clientDesc) {
			this.clientDesc = clientDesc;
		}
		public void setException(Exception exception) {
			this.exception = exception;
		}
		public void setLogDesc(String logDesc) {
			this.logDesc = logDesc;
		}
		public void setLogType(String logType) {
			this.logType = logType;
		}
		public void setLogDateTime(String logDateTime) {
			this.logDateTime = logDateTime;
		}
		public void setClientType(String clientType) {
		this.clientType = clientType;
		}
		public String toString(){
			if(null == exception ){
				return "logType="+logType+" logDateTime="+logDateTime+" logDesc="+logDesc+" clientDest="+clientDesc+" clientType="+clientType;
			}
			else{
				return "logType="+logType+" logDateTime="+logDateTime+" logDesc="+logDesc+" Exception="+exception.getMessage()+" clientDest="+clientDesc+" clientType="+clientType;
			}
		}
}
